// /*
//  * Copyright (C) 2015-2017 Alibaba Group Holding Limited
//  */

// #include <stddef.h>
// #include <stdio.h>
// #include <aos/hal/flash.h>
// #include "flash_partitions.h"

// /* Logic partition on flash devices */
// const hal_logic_partition_t hal_partitions[] =
// {
//     [HAL_PARTITION_BOOTLOADER] =
//     {
//         .partition_owner            = HAL_FLASH_QSPI,
//         .partition_description      = "Bootloader",
//         .partition_start_addr       = BOOTLOADER_PARTITION_START,
//         .partition_length           = BOOTLOADER_PARTITION_SIZE,    
//         .partition_options          = PAR_OPT_READ_EN | PAR_OPT_WRITE_DIS,
//     },
//     [HAL_PARTITION_CUSTOM_1] =
//     {
//         .partition_owner            = HAL_FLASH_QSPI,
//         .partition_description      = "Boot para",
//         .partition_start_addr       = BOOTLOADER_PARAM_PARTITION_START,
//         .partition_length           = BOOTLOADER_PARAM_PARTITION_SIZE,  
//         .partition_options          = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
//     },
//     [HAL_PARTITION_APPLICATION] =
//     {
//         .partition_owner            = HAL_FLASH_QSPI,
//         .partition_description      = "Application",
//         .partition_start_addr       = APPLICATION_PARTITION_START,
//         .partition_length           = APPLICATION_PARTITION_SIZE,  
//         .partition_options          = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
//     },
//     [HAL_PARTITION_PARAMETER_2] =
//     {
//         .partition_owner            = HAL_FLASH_QSPI,
//         .partition_description      = "Key Value",
//         .partition_start_addr       = KV_PARTITION_START,
//         .partition_length           = KV_PARTITION_SIZE,  
//         .partition_options          = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
//     },
//     [HAL_PARTITION_FATFS] = 		
// 	{
// 		.partition_owner			= HAL_FLASH_QSPI,
// 		.partition_description		= "fatfs",
// 		.partition_start_addr		= FS_PARTITION_START,
// 		.partition_length			= FS_PARTITION_SIZE,  
// 		.partition_options			= PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
// 	},
// #if 0
//     [HAL_PARTITION_CUSTOM_1] =
//     {
//         .partition_owner            = HAL_FLASH_QSPI,
//         .partition_description      = "user data",
//         .partition_start_addr       = CUSTOM_PARTITION_START,
//         .partition_length           = CUSTOM_PARTITION_SIZE,  
//         .partition_options          = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
//     },
// #endif
// };

// hal_logic_partition_t* flash_get_info(hal_partition_t in_partition)
// {
//     hal_logic_partition_t *logic_partition;

//     logic_partition = (hal_logic_partition_t *)&hal_partitions[ in_partition ];

//     return logic_partition;
// }

// int print_partiton_table(void)
// {
//     hal_logic_partition_t *boot_info = flash_get_info(HAL_PARTITION_BOOTLOADER);
//     hal_logic_partition_t *bootpara_info = flash_    get_info(HAL_PARTITION_CUSTOM_1);
//     hal_logic_partition_t *app_info = flash_get_info(HAL_PARTITION_APPLICATION);
//     if(boot_info == NULL || bootpara_info == NULL || app_info == NULL) {
//         printf("\r\nGet Flash info err !\n");
//         return -1;
//     }
//     printf("\n\n*************************FLASH PARTITION TABLE***************************\n");
//     printf("\t%-20s%-20s%-20s\n", "Part Name", "Start Addr", "Part Length");      
//     printf("\t%-20s0x%-18x0x%-18x\n", "Bootloader", boot_info->partition_start_addr,
//                boot_info->partition_length);
//     printf("\t%-20s0x%-18x0x%-18x\n", "Bootloader para", bootpara_info->partition_start_addr,
//                bootpara_info->partition_length);
//     printf("\t%-20s0x%-18x0x%-18x\n", "Application", app_info->partition_start_addr,
//                app_info->partition_length);
//     printf("\n*************************************************************************\n");

//     return 0;
// }
